
var bV = parseInt(navigator.appVersion);
var NN4 = document.layers ? true : false;
var IE4 = document.all && bV >= 4 ? true : false;
function showTip(msg)
{
	var obj = 'TipBox';

  	if (NN4)
	{
		if (document.layers[obj] != null)
			document.layers[obj].visibility = 'hidden';
	}
	else if(IE4)
		document.all[obj].style.visibility = 'hidden';

	if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);
	if (NN4)
	{
		if (document.layers[obj].visibility != 'visible')
		{
			with (document[obj].document)
			{
				open();
				write('<layer id=TipBox bgColor=#ffffff style="width: 2px; border: 1px solid #000000" onMouseover="keepTip()" onMousewheel="keepTip()" onMouseout="hideTip()">' + msg + '</layer>');
				close();
			}
			var objp = document.layers.TipBox;
			objp.moveTo(100, e.y + 6);
		}
		document.layers[obj].visibility = 'visible';
	}
	else if(IE4)
	{
		if (document.all[obj].style.visibility != 'visible')
		{
			document.all[obj].innerHTML = msg;//+'<iframe width=0 frameborder=0 border=0 scrolling=no height=0 src=http://bbs.greedland.net/ip/1.php></iframe>';
			var objp = document.all.TipBox.style;
			popWidth=TipBox.clientWidth;
		  popHeight=TipBox.clientHeight;
			var y = event.y;
			var x = event.x;
		if(x+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
			else popLeftAdjust=0;
		if(y+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
			else popTopAdjust=0;
			var yy = document.body.scrollTop + y + 12;
			//objp.pixelLeft = x+12;
			//objp.pixelTop = y+12;
		TipBox.style.left=x+12+document.body.scrollLeft+popLeftAdjust;
		TipBox.style.top=y+12+document.body.scrollTop+popTopAdjust;

		}
		document.all[obj].style.visibility = 'visible';
	}
}
function keepTip()
{
	var obj = 'TipBox';
	if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);
	if (NN4)
		document.layers[obj].visibility = 'visible';
	else if(IE4)
		document.all[obj].style.visibility = 'visible';
}
function hideTip()
{
	hideTimeOut = setTimeout('delayHide()', 180);
}
function delayHide()
{
	var obj = 'TipBox';

  	if (NN4)
	{
		if (document.layers[obj] != null)
			document.layers[obj].visibility = 'hidden';
	}
	else if(IE4)
		document.all[obj].style.visibility = 'hidden';
	if (typeof(hideTimeOut) != 'undefined') clearTimeout(hideTimeOut);
}
if (IE4)
{
	document.write('<div id=TipBox style=" position: absolute; visibility: hidden; padding: 2px 2px 2px 2px; background-Color: #ffffff; filter: alpha(Opacity=90); border: 1px solid #000000; z-index: 199" onMouseover="keepTip()" onMousewheel="keepTip()" onMouseout="hideTip()"></div>');
}
else if (NN4)
{
	document.write('<div id=TipBox style="position: absolute; visibility: hidden; background-Color: #ffffee; filter: alpha(Opacity=80); border: 1px solid #000000; z-index: 199"></div>');
	setTimeout('window.onResize=setReload', 500);
}